package com.fingard.dsp.bank.directbank.smbc01;

import com.fingard.dsp.bank.directConfig.TaskTimerSet;
import com.fingard.dsp.bank.directbank.bankInterface.IScheduleTask;
import com.fingard.text.StringHelper;
import com.fingard.util.ForeignBankUtil;

/**
 * 三井住友
 * @version 1.0
 */
public class SMBC01ScheduleTask extends SMBC01Base implements IScheduleTask {

    public ForeignBankUtil foreignBankUtil=null;

    @Override
    public void execTask(TaskTimerSet timerSet) {
        try {
            if (timerSet.taskNameList.toLowerCase().contains("downreceivefiles")) {
                String splitFlag=StringHelper.hasAnyChar(getBankConfig().getValueAsString("splitFlag"))
                        ?getBankConfig().getValueAsString("splitFlag"):"\r\n-";//内容分隔符
                String startFlag=StringHelper.hasAnyChar(getBankConfig().getValueAsString("startFlag"))
                        ?getBankConfig().getValueAsString("startFlag"):"{4:";//解析内容起始符号
                String endFlag=StringHelper.hasAnyChar(getBankConfig().getValueAsString("endFlag"))
                        ?getBankConfig().getValueAsString("endFlag"):"-}";//解析内容终止符号
                foreignBankUtil=new ForeignBankUtil(timerSet,getBankConfig(),bankFront,getSbLog(),getCharset(),splitFlag,startFlag,endFlag);
                foreignBankUtil.downloadFiles(SMBC01Base.class,"sftpserver");
            }
        } catch (Exception ex) {
            this.WriteBankLogLn(ex);
        }
    }
}
